<div class="layui-hide" id='enian-nav-bar'>
	<!-- 默认选中菜单左侧 -->
	<a type='menu' data-url="{:url('index/applist')}"></a>
	<a data-url="{:url('index/applist')}">应用列表</a>
	<a data-url="">添加应用</a>
</div>



<form class="layui-form" method="POST" action="" style="margin-right: 20px;">
	<div class="layui-form-item">
		<label class="layui-form-label">应用名称</label>
		<div class="layui-input-inline">
			<input type="text" name="name" lay-verify="required" placeholder="请输入" autocomplete="off" class="layui-input">
		</div>
	</div>
	<div class="layui-form-item">
		<label class="layui-form-label">备注</label>
		<div class="layui-input-inline">
			<input type="text" name="note" placeholder="请输入" autocomplete="off" class="layui-input">
		</div>
	</div>
	<div class="layui-form-item">
		<div class="layui-input-block">
			<button class="layui-btn" lay-submit lay-filter="addApp">立即提交</button>
		</div>
	</div>
</form>


<script>

	layui.use(['form','layer'], function() {
		var form = layui.form;

		//监听提交
		form.on('submit(addApp)', function(data) {
			//layer.msg(JSON.stringify(data.field));
			
			layui.$.post("{:url('',['t'=>1])}?appid={:input("param.appid")}",data.field, function(data) {
				if(data.code==1){
					layui.layer.msg('添加成功');
					enianAdmin.go("{:url('index/applist')}")
				}else{
					layui.layer.alert('添加失败')
				}
			});
			return false;
		});
	});
</script>